﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wjtour.Common;
using Hjp.FrameWork.Common;

namespace Wjtour.Web.Front
{
    public partial class articlemanage : MemberBasePage
    {
        private int page = 1;
        private Wjtour.BLL.article_bll _bll = new BLL.article_bll();
        protected PaginationData<Wjtour.Domain.article> data = new PaginationData<Wjtour.Domain.article>();
        protected string act = "";
        protected int id = 0;

        protected void Page_Load(object sender, EventArgs e)
        {
            page = Utils.StrToInt(Request["page"], 1);
            id = Utils.StrToInt(Request["id"], 0);
            act = Request["act"];
            if (act == "del" && id>0)
            {
                _bll.BatchDelete(id.ToString());
                Response.Redirect("articlemanage.aspx");
            }

            bindList();
        }

        void bindList()
        {
            data = _bll.GetList("6",CurrentMember.id, page - 1, 5);
            PagnationHtml = GetPageHtml("articlemanage.aspx", page, data.Pager.TotalPages);
        }
    }
}
